﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.types;
using l1cs.server.model.map;

namespace l1cs.server.model
{
    public class L1MapArea : Rectangle
    {
        private L1Map _map = L1Map.newNull();

        public L1MapArea( int left, int top, int right, int bottom, int mapId )
            : base( left, top, right, bottom )
        {
            _map = L1WorldMap.getInstance().getMap( (short)mapId );
        }

        public L1Map getMap()
        {
            return _map;
        }

        public void setMap( L1Map map )
        {
            _map = map;
        }

        public int getMapId()
        {
            return _map.getId();
        }

        public bool contains( L1Location loc )
        {
            return ( _map.getId() == loc.getMap().getId() ) && base.contains( loc );
        }
    }
}
